// BaseBbsState.h: interface for the CBaseBbsState class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_BASEBBSSTATE_H__8C6E78E7_F5E7_4D43_BFED_2C5D0E21EDA6__INCLUDED_)
#define AFX_BASEBBSSTATE_H__8C6E78E7_F5E7_4D43_BFED_2C5D0E21EDA6__INCLUDED_

#include "IBbsState.h"
#include "AnsiScreen.h"

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

typedef enum enumMouseClickAction
{
	mcaNone,
	mcaExit,
	mcaHome,
	mcaEnd,
	mcaPrev,
	mcaNext,
	mcaPageup,
	mcaPagedown,
	mcaEnter,
} MouseClickAction;

class CBaseBbsState : public IBbsState
{
protected:
	CAnsiScreen *m_pScreen;
	IVirtualKeyboard *m_pKeyboard;
	int colCharCount(char** chars, int x, int minY, int maxY);
	int lastNonSpaceCol(char** chars, int y, int minX, int maxX);
	void setScreenEffects(RECT* pRect, BYTE effect);
	BOOL ptOnRect(RECT* pRect, POINT* pPoint);

protected:
	virtual HCURSOR GetCursor(CPoint ptCursorCell);
	virtual BOOL OnClick(CPoint ptCursorCell);

public:
	virtual BOOL OnMouseDown(CPoint ptCell, UINT nFlags);
	virtual BOOL OnMouseMove(CPoint ptCell, UINT nFlags);
	virtual BOOL OnMouseUp(CPoint ptCell, UINT nFlags);
	virtual BOOL OnMouseWheel(CPoint ptCell, UINT nFlags, short wheelNotches);

	virtual BOOL OnFreezeMouse(BOOL bFreeze);

public:
	virtual BOOL CheckState(CAnsiScreen *pScreen, CPoint ptCursorCell, IBbsState *pPrevState);
	virtual void Activate();
	virtual void Deactivate();
	virtual void SetKeyboard(IVirtualKeyboard *pKeyboard);

public:
	CBaseBbsState();
	virtual ~CBaseBbsState();

};

#endif // !defined(AFX_BASEBBSSTATE_H__8C6E78E7_F5E7_4D43_BFED_2C5D0E21EDA6__INCLUDED_)
